/*
 * DataListModel.h
 *
 *  Created on: Jan 8, 2009
 *      Author: sez
 */

#ifndef DATALISTMODEL_H_
#define DATALISTMODEL_H_

#include <DndData/DndData.h>

#include <QStandardItemModel>

template <typename T>
class DataListModel: public QStandardItemModel
{
public:
	DataListModel(const char *names[], int size, QIcon icon, QObject *parent = 0);
	virtual ~DataListModel();
	QList<T> selected() const;
	void setSelected(QList<T>);
};

typedef DataListModel<DndData::Language> LanguagesModel;
LanguagesModel *makeLanguagesModel(QObject *parent = 0);

typedef DataListModel<DndData::SkillTypes> SkillsModel;
SkillsModel *makeSkillsModel(QObject *parent = 0);

typedef DataListModel<DndData::Ability> AbilitiesModel;
AbilitiesModel *makeAbilitiesModel(QObject *parent = 0);

typedef DataListModel<DndData::ClassName> SimpleClassModel;
SimpleClassModel *makeSimpleClassModel(QObject *parent = 0);

typedef DataListModel<DndData::RaceName> SimpleRaceModel;
SimpleRaceModel *makeSimpleRaceModel(QObject *parent = 0);

#endif /* DATALISTMODEL_H_ */
